package com.kaishengit.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.kaishengit.dao.UserprojectDao;
import com.kaishengit.pojo.Project;
import com.kaishengit.pojo.User;
import com.kaishengit.pojo.Userproject;

@Service
@Transactional
public class UserprojectService {
	private UserprojectDao userprojectDao;
	
	public void save(Userproject userproject){
		userprojectDao.save(userproject);
	}
	
	public void del(int id){
		userprojectDao.del(id);
	}
	
	public Userproject findById(int id){
		return userprojectDao.findById(id);
	}
	
	public List<Userproject> findAll(int id){
		return userprojectDao.findAll();
	}

	public UserprojectDao getUserprojectDao() {
		return userprojectDao;
	}

	public List<Userproject> findByProjectId(Project project) {
		return userprojectDao.findByProjectId(project);
	}
	@Autowired
	public void setUserprojectDao(UserprojectDao userprojectDao) {
		this.userprojectDao = userprojectDao;
	}

	public List<Userproject> findByUser(User user) {
		return userprojectDao.findByUser(user);
	}

	
}
